import time
import random
import datetime
import os
import json

# print(len(str(int(time.time()*1000))))
# def grab_red_packet(total, num):
#     red_packet_list = []
#     for i in range(num - 1):
#         one_red_packet = random.randint(1, int(total*0.6))
#         total = total - one_red_packet
#         red_packet_list.append(one_red_packet)
#     red_packet_list.append(total)
#     return red_packet_list
#
# total_mount = 100
# person_num = 7
# print(grab_red_packet(total_mount, person_num))
# d1 = datetime.date(year=2000, month=3, day=16)
# print(d1.weekday())
# d2 = d1 + datetime.timedelta(days=100)
# print(d2)
# print(d2.strftime('%Y/%m/%d'))
# path1 = "Users"
# path2 = "yuanHao"
# path3 = "python"
# print(os.sep)
# print(os.path.join(path1, path2, path3))
# print(os.getcwd())
# if not os.path.exists("./apple"):
#     os.mkdir("apple")
#     with open("banana.txt", mode="w", encoding="utf-8") as f:
#         f.write("香蕉")
# with open("data.json", encoding="utf-8") as f:
#     # data_json = f.read()
#     data_dic = json.load(f)
# print(data_dic, type(data_dic))
# data_list = data_dic.get("students")
# for stu in data_list:
#     print(f"姓名：{stu['name']:10} 选修课程：{[i['title'] for i in stu['courses']]}")
# ret = os.popen("hostname")
# print(list(ret))
# date01_string = "1990-01-2"
# date02_string = "2022/06/30"
# parsed_date01 = datetime.datetime.strptime(date01_string, "%Y-%m-%d")
# parsed_date02 = datetime.datetime.strptime(date02_string, "%Y/%m/%d")
# print(parsed_date01)
# print(parsed_date02)
# ret = parsed_date02 - parsed_date01
# print(ret, type(ret))
# print(ret.days)
# print(os.getcwd())
# print(os.path.dirname(os.path.dirname(os.getcwd())))
print(os.path.dirname(__file__))
